<template>
    <div class="card-box">
        <template>
            <el-dialog :visible.sync="dialogVisible"  width="900px" title="短信信息详情" :close-on-click-modal="false">
               <table :data="assessInfoData">
                   <tr>
                       <td  class="trrone">短信类型：</td>
                       <td class="trr">{{_assessInfoData.smsType === '10' ? '即时短信' : '延时短信'}}  </td>
                       <td  class="trrone">接收人：</td>
                       <td  class="trr">{{_assessInfoData.receiveName}}</td>
                   </tr>
                   <tr>
                       <td  class="trrone">手机号：</td>
                       <td  class="trr">{{_assessInfoData.receiveMobile}}</td>
                       <td  class="trrone">短信内容：</td>
                       <td  class="trr">{{_assessInfoData.smsContent}}</td>
                   </tr>
                   <tr>
                       <td  class="trrone">发送时间：</td>
                       <td  class="trr">{{_assessInfoData.sendTime}}</td>
                       <td  class="trrone">短信状态：</td>
                       <td  class="trr">{{_assessInfoData.smsStatus}}</td>
                   </tr>
               </table>


               <!-- <el-table :data="assessInfoData">
                    <el-table-column label="短信类型" prop="busType"  align="center" width="100" />
                    <el-table-column label="接收人" prop="receiveName"  align="center" width="100" />
                    <el-table-column label="手机号" prop="receiveMobile"  align="center" width="100" />
                    <el-table-column label="短信内容" prop="smsContent"  align="center" width="100" />
                    <el-table-column label="发送时间" prop="sendTime"  align="center" width="100" />
                    <el-table-column label="短信状态" prop="smsStatus"  align="center" width="100" />
                </el-table>-->
            </el-dialog>
        </template>
    </div>
</template>

<script>
    import {fetchList, addObj, putObj, delObj,getObj} from '~/admin/api/note'


    export default {
        name: "sms-view",
        data(){
            return{
                dialogVisible:false,
                assessInfoData:[],
            }
        },
        computed:{
            _assessInfoData(){
                return this.assessInfoData.length ? this.assessInfoData[0] : {}
            }
        },
        methods:{
            show(rowData){
                this.loading = false
                this.assessInfoData=[]
                getObj(rowData).then(response=>{
                    this.assessInfoData.push(Object.assign({},response.data.data))
                    if(this.assessInfoData[0].smsStatus=='0'){
                        this.assessInfoData[0].smsStatus='未发送'
                    }else  if(this.assessInfoData[0].smsStatus=='1'){
                        this.assessInfoData[0].smsStatus='发送成功'
                    }else  if(this.assessInfoData[0].smsStatus=='2'){
                        this.assessInfoData[0].smsStatus='取消发送'
                    }else  if(this.assessInfoData[0].smsStatus=='9'){
                        this.assessInfoData[0].smsStatus='发送失败'
                    }
                })
                this.dialogVisible = true
            },
            closeDialog(){
                this.dialogVisible = false
            }
        }
    }
</script>

<style lang="scss" scoped>
    .trrone{
        font-size: 16px;
        width: 10%;
        /*border: 1px solid black;*/
        padding-bottom: 10px;
    }
    .trr{        font-size: 16px;

        width: 40%;
        padding-bottom: 10px;
        /*border: 1px solid black;*/

    }
</style>
